<?php
use common\models\Category;

$items = [
    ['label' => '基础管理', 'options' => ['class' => 'header']],
    ['label' => '栏目管理', 'icon' => 'file-code-o', 'url' => ['/category']],
    ['label' => '报名管理', 'icon' => 'file-code-o', 'url' => ['/signup']],
    ['label' => '课程管理', 'icon' => 'fa fa-dashboard', 'url' => '/course'],
    ['label' => '信息管理', 'options' => ['class' => 'header']],
];
foreach (Category::find()->where('pid != 0 and id not in(3,4,9)')->all() as $item) {
    $items[] = ['label' => $item->title, 'icon' => 'fa fa-dashboard', 'url' => '/article?ArticleSearch[cid]=' . $item->id];
}

$items[] = ['label' => '教练管理', 'options' => ['class' => 'header']];

foreach (Category::find()->where('pid != 0 and id in(3,4,9)')->all() as $item) {
    $items[] = ['label' => $item->title, 'icon' => 'fa fa-dashboard', 'url' => '/coach?CoachSearch%5Bpid%5D=' . $item->id];
}
?>
<aside class="main-sidebar">

    <section class="sidebar">

        <!-- search form -->
        <form action="#" method="get" class="sidebar-form">
            <div class="input-group">
                <input type="text" name="q" class="form-control" placeholder="Search..."/>
              <span class="input-group-btn">
                <button type='submit' name='search' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i>
                </button>
              </span>
            </div>
        </form>
        <!-- /.search form -->

        <?= dmstr\widgets\Menu::widget(
            [
                'options' => ['class' => 'sidebar-menu'],
                'items' => $items
            ]
        ) ?>

    </section>

</aside>
